import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/view/layout/layout';
import demoRouter from './demo/demoRouter';

import ziyuanRouter from './pages/ziyuanRouter';
import yingyongRouter from './pages/yingyongRouter';
import bianpaiRouter from './pages/bianpaiRouter';
import shiliRouter from './pages/shiliRouter';
import jiankongRouter from './pages/jiankongRouter';
import rizhiRouter from './pages/rizhiRouter';
import zidianRouter from './pages/zidianRouter';
import xitongRouter from './pages/xitongRouter';

export const constantRouterMap = [
	...demoRouter,

	{
		path : "",
		redirect : "/index",
	},
	
	{
    path: '/index',
    component: Layout,
    name: 'app.index',
    meta : {
    		title : "概览",
    		iconfont : "icon-gailan",
    },
    children : [{
    	path : "/index",
    	component: () => import('@/view/pages/index'),
    	name: 'app.index',
    	meta : {
    		title : "概览",
    		iconfont : "icon-gailan",
    	}
    }]
  },
  
//	{
//		path : "/dashboard",
//		redirect : "/demo/index",
//	},
	
	...ziyuanRouter,
	...yingyongRouter,
	...bianpaiRouter,
	...shiliRouter,
	...jiankongRouter,
	...rizhiRouter,
	// ...zidianRouter,
	...xitongRouter,
	
	
//{
//  path: '/404',
//  meta: {
//    // icon: 'documentation',
//    title: '404'
//  },
//  component: Layout,
//  hidden: true,
//  children: [
//    {
//      path: '/404',
//      component: () => import('@/views/errorPage/404s'),
//      name: '404',
//      meta: {
//        title: '404'
//      },
//      hidden: true
//    }
//  ]
//},
//{
//  path: '/401',
//  component: () => import('@/views/errorPage/401'),
//  hidden: true
//},
  
]

export default new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
})


export const asyncRouterMap = []


